# -*- coding: utf-8 -*-            
# @Time : 2025/5/9 11:00
# @Author: ZZC
# @proj: BERT_NO1

import torch
from transformers import AutoModel, AutoTokenizer

bertweet = AutoModel.from_pretrained("../bertweet-base")

tokenizer = AutoTokenizer.from_pretrained("../bertweet-base")

# INPUT TWEET IS ALREADY NORMALIZED!
line = "DHEC confirms HTTPURL via @USER :crying_face:"

input_ids = torch.tensor([tokenizer.encode(line)])

with torch.no_grad():
    features = bertweet(input_ids)  # Models outputs are now tuples

## With TensorFlow 2.0+:
# from transformers import TFAutoModel
# bertweet = TFAutoModel.from_pretrained("vinai/bertweet-large")
if __name__ == '__main__':
    pass
